<ul id="nav">
    <ul class="nav">

        <li class="first <?if ($this->uri->segment(1)=="about") print "active"?>"><a href="<?=site_url('about')?>" title="About <?=INSTANCE_NAME?>"><? if (INSTANCE_IS_DEFERRANTI===TRUE) echo "Home"; else echo "About"; ?></a>
<?
// Def only - start
if (INSTANCE_IS_DEFERRANTI !== TRUE) { 
?>

            <ul>

			<?
            $i = 0;
            foreach($about as $item) { 

                $classes=array();
                if (($this->uri->segment(1)=="about") && ($this->uri->segment(2)==$item['id']))
                    $classes[] = 'active';                

                if ($i==0) 
                    $classes[] = 'first';                
                else if ($i==count($about)-1) 
                    $classes[] = 'last';                

                $class = 'class="' .implode(",", $classes). '"';


            ?>
                <li <?=$class?>><a href="<?=site_url('about/'.$item['id'])?>" title="<?=strip_quotes($item['title'])?>"><?=$item['title']?></a></li>
            <? 
            $i++;
            } 
            ?>

            </ul>

<?
}
// Def only - end
?>

        </li>         
        <li <?if ($this->uri->segment(1)=="products") print 'class="active"'?>><a href="<?=site_url('products/')?>" title="Products">Products</a>
        <?
        if ($this->uri->rsegment(1)=="products" &&
            ($this->uri->segment(2)=="categories" ||
            $this->uri->segment(2)=="view")
            )
            $class = ' active';
        else $class = '';
        ?>
            <ul>
                <li class="first<?=$class?>"><a href="<?=site_url('products/categories')?>" title="Products by Category">Products by Category</a></li>
                <li <?if ($this->uri->rsegment(1)=="products" && $this->uri->segment(2)=="applications") print 'class="active"'?>><a href="<?=site_url('products/applications')?>" title="Products by Application">Products by Application</a></li>
                <li class="last  <?if ($this->uri->rsegment(1)=="products" && $this->uri->segment(2)=="one_off_floors") print 'active'?>"><a href="<?=site_url('products/one_off_floors')?>" title="One-off Floors">One-off Floors</a></li>
            </ul>
        </li>
        <li <?if ($this->uri->segment(1)=="wishlist") print 'class="active"'?>><a href="<?=site_url('wishlist')?>" title="Wish List">Wish List</a>
        <? if (!empty($wishlists)){ ?>
            <ul>
                <li class="first"><a href="<?=site_url('wishlist')?>" title="Show All">Show All</a></li>
            <? 
            $i = 0;
            foreach($wishlists as $item) { 

                if ($i==count($about)-1) $class='class="last"';
                else $class='';

            ?>
                <li <?=$class?>><a href="<?=site_url('wishlist/view/'.$item['id_Wishlists'])?>" title="<?=strip_quotes($item['Title_Wishlists'])?>"><?=$item['Title_Wishlists']?></a></li>
            <? 
            $i++;
            } 
            ?>
            </ul>
        <? } ?>

        </li>
        <li <?if ($this->uri->segment(1)=="portfolio") print 'class="active"'?>><a href="<?=site_url('portfolio')?>" title="Portfolio">Portfolio</a></li>
        <li <?if ($this->uri->segment(1)=="news") print 'class="active"'?>><a href="<?=site_url('news')?>" title="News">News</a></li>
        <li <?if ($this->uri->segment(1)=="publicity") print 'class="active"'?>><a href="<?=site_url('publicity')?>" title="Publicity">Publicity</a></li>
        <li><a href="<?=site_url('contact_us')?>" title="Contact Us">Contact Us</a></li>

        <?
        if ($this->uri->rsegment(1)=="extras" ||
            $this->uri->segment(1)=="faq" ||
            $this->uri->segment(1)=="articles" ||
            $this->uri->segment(1)=="exhibitions" ||
            $this->uri->segment(1)=="career_opportunities" ||
            $this->uri->segment(1)=="friends")
            $class = 'class="active"';
        else $class = '';
        ?>
        <li <?=$class?>><a href="<?=site_url('extras')?>" title="Extras">Extras</a>
            <ul>
                <li class="first <?if ($this->uri->rsegment(1)=="glossary") print "active"?>"><a href="<?=site_url('glossary')?>" title="Glossary">Glossary</a></li>
                <li <? if ($this->uri->segment(1)=="faq") print 'class="active"'?>><a href="<?=site_url('faq')?>" title="FAQ">FAQ</a></li>
                <li <? if ($this->uri->segment(1)=="articles") print 'class="active"'?>><a href="<?=site_url('articles')?>" title="Articles">Articles</a></li>
                <li <? if ($this->uri->segment(1)=="exhibitions") print 'class="active"'?>><a href="<?=site_url('exhibitions')?>" title="Exhibitions">Exhibitions</a></li>
                <li <? if ($this->uri->segment(1)=="career_opportunities") print 'class="active"'?>><a href="<?=site_url('career_opportunities')?>" title="Career Opportunities">Career Opportunities</a></li>
                <li class="last <?if ($this->uri->segment(1)=="friends") print 'active'?>"><a href="<?=site_url('friends')?>" title="Friends">Friends</a></li>
            </ul>
        </li>
        <li <?if ($this->uri->segment(1)=="search") print 'class="active"'?>><a href="<?=site_url('search')?>" title="Search">Search</a>
            <ul>
                <li class="first <?if ($this->uri->segment(1)=="search" && $this->uri->segment(2)=="results") print 'active'?>"><a href="<?=site_url('search/results')?>" title="Search">searchresults</a></li>
            </ul>
        </li>
        <?
        if ($this->uri->segment(1)=="insider" ||
            $this->uri->segment(1)=="login" ||
            $this->uri->segment(1)=="register" ||
            $this->uri->segment(1)=="newsletters")
            $class = ' active';
        else $class = '';
        ?>
        <li class="last <?=$class?>"><a href="<?=site_url('insider')?>" title="<?=$this->lang->line('Members_Program') ?>"><?=$this->lang->line('Members_Program') ?></a>
            <ul>

        <? if (session_check()) {?>

            <li class="first <? if ($this->uri->segment(2)=="profile") print ' active'?>" ><a href="<?=site_url('insider/profile')?>">Your Profile</a></li>
            <li <? if ($this->uri->segment(2)=="edit_password") print 'class="active"'?>><a href="<?=site_url('insider/edit_password')?>">Change Password</a></li>
            <li><a href="<?=site_url('logout')?>">Logout</a></li>

        <? } else { ?>

            <li class="first <? if ($this->uri->segment(1)=="login") print 'active'?>"><a href="<?=site_url('login')?>" title="Login">Login</a></li>
            <li <? if ($this->uri->segment(1)=="register") print 'class="active"'?>><a href="<?=site_url('register')?>" title="Create an Account">Create an Account</a></li>
            <li class="last <? if ($this->uri->segment(1)=="newsletters") print 'active'?>"><a href="<?=site_url('newsletters')?>" title="Newsletters">Newsletters</a></li>

        <? }?>

            </ul>
        </li>
    </ul>
</ul>